
#ifndef D3D11APP_H
#define D3D11APP_H

#include "DXGI.h"
#include "D3D11.h"

#include "GameTimer.h"
#include "DeviceManager.h"
#include <string>


class D3d11App
{
public:
	D3d11App(HINSTANCE hInstance);
	virtual ~D3d11App();

	HINSTANCE GetAppInst();
	HWND      GetMainWnd();

	int Run();

	// Framework methods.  Derived client class overrides these methods to 
	// implement specific application requirements.

	virtual void Init();
	virtual void Update(float dt);
	virtual void Draw(); 
	virtual LRESULT MsgProc(UINT msg, WPARAM wParam, LPARAM lParam);

protected:
	void Abort();

	DeviceManager *mpDeviceManager;
	HWND      mhMainWnd;

	virtual void OnResize();// reset projection/etc
	float GetGameTime()const;  // in seconds

private:
	void InitMainWindow();
	void InitDirect3D();
	void InitResources();

	HINSTANCE mhAppInst;
	bool      mAppPaused;
	bool      mMinimized;
	bool      mMaximized;
	bool      mResizing;

	GameTimer mTimer;

	std::wstring mFrameStats;

	// Derived class should set these in derived constructor to customize starting values.
	std::wstring mMainWndCaption;
	
	int mClientWidth;
	int mClientHeight;
};

#endif